﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Resources;

public partial class MasterPage : System.Web.UI.MasterPage
{
    
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = Resources.Lang.MainPageTitle.ToString();
        if (HttpContext.Current.User.Identity.Name != "")
        {
            lblUserName.Text = Resources.Lang.USER_ID.ToString() + " &nbsp;&nbsp;&nbsp;&nbsp;" + HttpContext.Current.User.Identity.Name;
            ltrIcons.Visible = true;
            btnSignOut.Visible = true;
        }

        //Check if user has a particular role
        //HttpContext.Current.User.IsInRole("admin")

        //Check if user is authenticated
        //HttpContext.Current.User.Identity.IsAuthenticated

        //Get UserName of the Authenticated User
        //HttpContext.Current.User.Identity.Name
    }
    protected void Page_PreInit(object sender, EventArgs e)
    {
        BasePage.SetLocalCulture();
    }
    protected void btnSignOut_Click(object sender, EventArgs e)
    {
        FormsAuthentication.SignOut();
        Response.Redirect("Login.aspx", true);
    }
    protected void btnExpXls_Click(object sender, ImageClickEventArgs e)
    {
        BasePage.ExpoprtInExcel(BasePage.Grid);     
    }    
}
